package co.fitstart.entity.courseware.assessment;

import com.demo2do.core.utils.Alias;

/**
 * 运动病史
 * @author haiyan_xiao
 *
 */
@Alias("disease")
public enum Disease {
    HYPERTENSION("hypertension", "高血压"),
    
    HYPOTENSION("hypotension", "低血压"),
    
    GOUT("gout", "痛风"),
    
    CARDIOPATHY("cardiopathy", "心脏病"),
    
    SPONDYLOSIS("spondylosis", "脊椎病");
    
    private String alias;
    
    private String description;
    
    private Disease(String alias, String description) {
        this.alias = alias;
        this.description = description;
    }
    
    /**
     * 
     * @param alias
     * @return
     */
    public static Disease aliasOf(String alias) {
        for (Disease disease : Disease.values()) {
            if (disease.alias.equalsIgnoreCase(alias)) {
                return disease;
            }
        }
        
        return null;
    }
    
    /**
     * 
     * @param ordinal
     */
    public static Disease ordinalOf(int ordinal) {
        for (Disease disease : Disease.values()) {
            if (disease.ordinal() == ordinal) {
                return disease;
            }
        }
        
        return null;
    }

    /**
     * @return the alias
     */
    public String getAlias() {
        return alias;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @param alias the alias to set
     */
    public void setAlias(String alias) {
        this.alias = alias;
    }

    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }
}
